1 00:00:00,000 --> 00:00:02,770 INTRODUCTION: The following content is provided by MIT 2 00:00:02,770 --> 00:00:06,090 OpenCourseWare under a Creative Commons license. 3 00:00:06,090 --> 00:00:08,680 Additional information about our license and MIT 4 00:00:08,680 --> 00:00:11,930 OpenCourseWare in general is available at OCW.MIT.edu. 5 00:00:11,930 --> 00:00:17,840 6 00:00:17,840 --> 00:00:18,880 PROFESSOR: OK. 7 00:00:18,880 --> 00:00:23,740 So I'll start now with the third lecture. 8 00:00:23,740 --> 00:00:26,600 And we're into partial differential equations. 9 00:00:26,600 --> 00:00:29,870 So we had two on ordinary differential equations and the 10 00:00:29,870 --> 00:00:34,420 idea of stability came up, and the order of accuracy came up. 11 00:00:34,420 --> 00:00:39,160 And those will be the key questions today -- 12 00:00:39,160 --> 00:00:42,990 accuracy and stability. 13 00:00:42,990 --> 00:00:46,740 We do get beyond that actually. 14 00:00:46,740 --> 00:00:53,630 I mean to look at the contour at the output from a 15 00:00:53,630 --> 00:00:57,180 difference m once you've decided yes it's stable, yes 16 00:00:57,180 --> 00:00:58,410 it's accurate. 17 00:00:58,410 --> 00:01:01,200 You still have to look at the output and see, you know, how 18 00:01:01,200 --> 00:01:06,440 good is it, where is it weak, where is it on target. 19 00:01:06,440 --> 00:01:11,830 But first come the accuracy and stability questions. 20 00:01:11,830 --> 00:01:15,620 And beginning with this equation. 21 00:01:15,620 --> 00:01:20,650 So this will be the simplest initial value problem 22 00:01:20,650 --> 00:01:23,950 we can think of. 23 00:01:23,950 --> 00:01:26,230 I call it a one way wave equation. 24 00:01:26,230 --> 00:01:30,720 Notice the two way wave equation, which we'll get too, 25 00:01:30,720 --> 00:01:33,890 would have second derivatives there. 26 00:01:33,890 --> 00:01:38,250 And that will send waves in both directions. 27 00:01:38,250 --> 00:01:41,720 This we'll see sends a wave only in one direction, so it's 28 00:01:41,720 --> 00:01:43,530 a nice scalar problem. 29 00:01:43,530 --> 00:01:45,290 First order constant 30 00:01:45,290 --> 00:01:47,610 coefficient, that's the velocity. 31 00:01:47,610 --> 00:01:49,670 Perfect. 32 00:01:49,670 --> 00:01:59,440 The model problem for wave equations. 33 00:01:59,440 --> 00:02:05,320 Because it's just first order, I just begin it with the 34 00:02:05,320 --> 00:02:10,270 function at time 0. 35 00:02:10,270 --> 00:02:12,400 So I'm looking for the solution at 36 00:02:12,400 --> 00:02:16,050 time t to this equation. 37 00:02:16,050 --> 00:02:17,270 OK. 38 00:02:17,270 --> 00:02:19,770 So that will not be hard to find. 39 00:02:19,770 --> 00:02:26,640 And I want to do it first for pure exponentials. 40 00:02:26,640 --> 00:02:31,040 When u of x0, the initial function, is a pure 41 00:02:31,040 --> 00:02:32,330 exponential e to the ikx. 42 00:02:32,330 --> 00:02:37,730 43 00:02:37,730 --> 00:02:40,070 Fourier is always around. 44 00:02:40,070 --> 00:02:45,460 And to see what happens suppose this is given, for 45 00:02:45,460 --> 00:02:51,390 example, so this will be my example, e to the ikx. 46 00:02:51,390 --> 00:02:52,020 OK. 47 00:02:52,020 --> 00:02:53,760 Now what's special about e to the ikx? 48 00:02:53,760 --> 00:02:56,600 49 00:02:56,600 --> 00:02:59,830 The special thing is that with constant coefficients and no 50 00:02:59,830 --> 00:03:05,710 boundaries, the solution will be a multiple of e to the ikx. 51 00:03:05,710 --> 00:03:11,000 In other words, we can separate variables. 52 00:03:11,000 --> 00:03:12,340 Maybe I'll put it here. 53 00:03:12,340 --> 00:03:20,490 I can then look for the solution u to be a function 54 00:03:20,490 --> 00:03:27,290 times a number really, but it will depend on the time on the 55 00:03:27,290 --> 00:03:34,430 frequency k and the time t times e to the ikx. 56 00:03:34,430 --> 00:03:39,410 You see how that separated variables? x is separated from 57 00:03:39,410 --> 00:03:45,550 t, and the frequency controls what this 58 00:03:45,550 --> 00:03:48,970 growth factor will be. 59 00:03:48,970 --> 00:03:53,410 So this growth factors is a key quantity to compute. 60 00:03:53,410 --> 00:03:57,810 And we compute it just by substituting that hope for a 61 00:03:57,810 --> 00:04:00,130 solution into the equation. 62 00:04:00,130 --> 00:04:03,820 And getting an equation for g, because e to 63 00:04:03,820 --> 00:04:05,250 the ikx will cancel. 64 00:04:05,250 --> 00:04:11,260 That's the key point, that everything remains a pure 65 00:04:11,260 --> 00:04:14,660 harmonic with that single frequency k. 66 00:04:14,660 --> 00:04:17,890 So if I plug it in, I get dg dt. 67 00:04:17,890 --> 00:04:21,710 68 00:04:21,710 --> 00:04:25,130 I'm taking the time derivative of u, times 69 00:04:25,130 --> 00:04:27,290 e to the ikx, right. 70 00:04:27,290 --> 00:04:28,630 That's du dt. 71 00:04:28,630 --> 00:04:33,800 Because t was separate from x, that's what I get when I 72 00:04:33,800 --> 00:04:35,400 plug in this u. 73 00:04:35,400 --> 00:04:38,380 So I'm always plugging in this u. 74 00:04:38,380 --> 00:04:42,420 What do I get on the right hand side? c, the x 75 00:04:42,420 --> 00:04:42,810 derivative. 76 00:04:42,810 --> 00:04:44,880 So that's just g. 77 00:04:44,880 --> 00:04:49,120 The x derivative will bring down ik, e to the ikx. 78 00:04:49,120 --> 00:04:53,000 79 00:04:53,000 --> 00:04:56,290 No surprise that I can cancel e to the ikx, 80 00:04:56,290 --> 00:04:58,010 which is never 0. 81 00:04:58,010 --> 00:05:02,550 And I have a simple equation for g. 82 00:05:02,550 --> 00:05:06,550 Linear constant coefficients, but the coefficient depends on 83 00:05:06,550 --> 00:05:07,700 k, of course. 84 00:05:07,700 --> 00:05:14,300 The coefficient is ick, and of course the solution is g is 85 00:05:14,300 --> 00:05:17,090 equal to -- 86 00:05:17,090 --> 00:05:19,860 we're back to our simplest model of an ordinary 87 00:05:19,860 --> 00:05:21,760 differential equation. 88 00:05:21,760 --> 00:05:26,235 Now the coefficient a is now ikc, so it's e 89 00:05:26,235 --> 00:05:30,070 to the ikct, right. 90 00:05:30,070 --> 00:05:32,910 91 00:05:32,910 --> 00:05:38,340 That shows us what happens to the e to the ikx. 92 00:05:38,340 --> 00:05:42,020 So now I'll put that here, because now we know it. 93 00:05:42,020 --> 00:05:47,790 So we have all together e to the ikct and here's an x. 94 00:05:47,790 --> 00:05:53,930 So let's put those together as x plus ct, because that's a 95 00:05:53,930 --> 00:05:57,030 guide to what's coming. 96 00:05:57,030 --> 00:06:01,500 So that's the solution: separated variables, look for 97 00:06:01,500 --> 00:06:05,630 the growth factor, tried an exponential. 98 00:06:05,630 --> 00:06:08,770 And we'll do exactly the same thing for difference method. 99 00:06:08,770 --> 00:06:12,720 So this was von Neumann's brilliant idea, watch 100 00:06:12,720 --> 00:06:16,370 exponentials, watch every frequency, and see what 101 00:06:16,370 --> 00:06:20,850 happens to the multiple of e to the ikx. 102 00:06:20,850 --> 00:06:25,950 Now here is very special, because all frequencies are 103 00:06:25,950 --> 00:06:31,600 producing this combination x plus ct. 104 00:06:31,600 --> 00:06:36,960 So when we combine frequency, that's what Fourier said, take 105 00:06:36,960 --> 00:06:40,920 combinations of these things. 106 00:06:40,920 --> 00:06:45,010 The solution will be a combination of these things. 107 00:06:45,010 --> 00:06:48,350 And what do we get? 108 00:06:48,350 --> 00:06:53,010 If our original function was u of x and 0, it's a combination 109 00:06:53,010 --> 00:06:55,860 of these, e to the ikx's. 110 00:06:55,860 --> 00:07:02,920 And at later time we have the same combination by linearity 111 00:07:02,920 --> 00:07:04,170 of these guys. 112 00:07:04,170 --> 00:07:06,720 113 00:07:06,720 --> 00:07:12,560 All that's happening is x is getting changed to x plus ct. 114 00:07:12,560 --> 00:07:15,320 115 00:07:15,320 --> 00:07:17,300 So I'm getting the answer. 116 00:07:17,300 --> 00:07:21,120 117 00:07:21,120 --> 00:07:26,440 Here was the answer for one exponential. 118 00:07:26,440 --> 00:07:29,230 But now I'm going to do the answer for a general u, and 119 00:07:29,230 --> 00:07:31,810 it's going to be easy to pick off. 120 00:07:31,810 --> 00:07:36,080 It's just like picking off this x plus ct. 121 00:07:36,080 --> 00:07:41,710 It will be u at x plus ct at time 0. 122 00:07:41,710 --> 00:07:46,240 That's the solution for every u. 123 00:07:46,240 --> 00:07:49,460 Not just for the exponentials, but for all combinations of 124 00:07:49,460 --> 00:07:52,480 them which give us any u of x and 0. 125 00:07:52,480 --> 00:07:58,730 So u of x and 0 was a combination of e to the ikx's, 126 00:07:58,730 --> 00:08:01,350 and then the solution is the same 127 00:08:01,350 --> 00:08:04,200 combination of these guys. 128 00:08:04,200 --> 00:08:10,420 Well, we can understand what that solution is. 129 00:08:10,420 --> 00:08:13,920 It's what I call a one way way. 130 00:08:13,920 --> 00:08:17,520 Let me understand what's happening here. 131 00:08:17,520 --> 00:08:19,480 So here's the key picture now. 132 00:08:19,480 --> 00:08:25,370 133 00:08:25,370 --> 00:08:29,460 I want to a draw a picture in the xt plane. 134 00:08:29,460 --> 00:08:31,960 So I'm not graphing u here. 135 00:08:31,960 --> 00:08:40,120 This is a picture in the xt plane that will show us what 136 00:08:40,120 --> 00:08:41,510 this formula means. 137 00:08:41,510 --> 00:08:46,190 Because this is the solution that we then want to 138 00:08:46,190 --> 00:08:48,730 approximate by difference method. 139 00:08:48,730 --> 00:08:49,060 OK. 140 00:08:49,060 --> 00:08:51,490 So what does this mean? 141 00:08:51,490 --> 00:08:56,620 This means that the value, for example, u of 0, 0. 142 00:08:56,620 --> 00:08:57,990 So there's the point 0, 0. 143 00:08:57,990 --> 00:09:05,830 144 00:09:05,830 --> 00:09:11,110 Here's what's happening, at a later time, say up here some 145 00:09:11,110 --> 00:09:19,320 later time, the value of u, this is the line, x plus ct 146 00:09:19,320 --> 00:09:25,480 equals 0; x plus ct equals 0 along that line. 147 00:09:25,480 --> 00:09:31,190 And what's the point on that line, the solution is the same 148 00:09:31,190 --> 00:09:32,300 all the way along. 149 00:09:32,300 --> 00:09:39,800 So whatever the initial value is here it travels, so that u 150 00:09:39,800 --> 00:09:42,150 at this point is u at this point. 151 00:09:42,150 --> 00:09:47,020 So let me to call that point P, and say what I mean now. 152 00:09:47,020 --> 00:09:52,750 I mean that u of P is the same as u at 0, 0. 153 00:09:52,750 --> 00:10:00,790 Because x plus ct is the same here and here. 154 00:10:00,790 --> 00:10:03,460 Let me take another point. 155 00:10:03,460 --> 00:10:10,730 Let's say x0 another initial value, and again along the 156 00:10:10,730 --> 00:10:12,610 line like this. 157 00:10:12,610 --> 00:10:19,670 This will be the line x plus ct equals capital X, because 158 00:10:19,670 --> 00:10:25,680 it's the line where x plus ct is a constant, and the 159 00:10:25,680 --> 00:10:30,730 constant is chosen so that it starts at this point at t 160 00:10:30,730 --> 00:10:35,490 equals 0, X big X. So now -- let's see -- 161 00:10:35,490 --> 00:10:42,160 I better make clear -- that this lines carries this 162 00:10:42,160 --> 00:10:43,370 initial value. 163 00:10:43,370 --> 00:10:47,500 This line carries this initial value. 164 00:10:47,500 --> 00:10:48,810 You see it? 165 00:10:48,810 --> 00:10:53,680 The value of u all along this line is the value it started 166 00:10:53,680 --> 00:10:54,950 with right there. 167 00:10:54,950 --> 00:10:58,500 And you know the name for those lines? 168 00:10:58,500 --> 00:11:03,100 So these are lines, they happen to be straight here 169 00:11:03,100 --> 00:11:07,450 because we got constant coefficients, straight and 170 00:11:07,450 --> 00:11:09,840 even parallel. 171 00:11:09,840 --> 00:11:13,090 And they're the lines on which the information travels. 172 00:11:13,090 --> 00:11:17,640 Whatever the information was at times 0. 173 00:11:17,640 --> 00:11:22,220 By information I mean the value of u at 0, 0, or the 174 00:11:22,220 --> 00:11:25,120 value of u at this point. 175 00:11:25,120 --> 00:11:27,950 That information travels along that line to give this 176 00:11:27,950 --> 00:11:30,030 solution all along the line. 177 00:11:30,030 --> 00:11:33,180 And the name of the line, anybody know it? 178 00:11:33,180 --> 00:11:34,820 Characteristic. 179 00:11:34,820 --> 00:11:45,005 So this is a characteristic line, they all are. 180 00:11:45,005 --> 00:11:45,660 This to. 181 00:11:45,660 --> 00:11:49,370 All these line are characteristic lines. 182 00:11:49,370 --> 00:11:50,655 Can you read characteristic? 183 00:11:50,655 --> 00:11:54,830 I should of have written it a little better. 184 00:11:54,830 --> 00:12:02,580 So this is like a key feature of wave equations. 185 00:12:02,580 --> 00:12:06,070 It's a key feature of wave equations that we will not see 186 00:12:06,070 --> 00:12:09,200 for heat equations. 187 00:12:09,200 --> 00:12:17,290 And so let me just say it again, because it will bear 188 00:12:17,290 --> 00:12:21,430 also on the stability question for difference equations. 189 00:12:21,430 --> 00:12:24,380 The information, the true information, for the true 190 00:12:24,380 --> 00:12:27,410 solution travels along characteristic lines. 191 00:12:27,410 --> 00:12:30,370 192 00:12:30,370 --> 00:12:35,110 We're in one dimension here, and which is a major 193 00:12:35,110 --> 00:12:36,590 simplification. 194 00:12:36,590 --> 00:12:42,970 In two dimensions we'll have characteristic cones. 195 00:12:42,970 --> 00:12:46,450 In three dimension certainly we'd call it a cone. 196 00:12:46,450 --> 00:12:50,900 And actually I guess what I'm saying is that if I speak a 197 00:12:50,900 --> 00:12:58,290 word, you know, my voice or the sound waves solve the 3D 198 00:12:58,290 --> 00:13:00,270 wave equation. 199 00:13:00,270 --> 00:13:06,580 So when I snap my fingers, that sound travels from this 200 00:13:06,580 --> 00:13:14,450 point out along characteristics. 201 00:13:14,450 --> 00:13:17,670 202 00:13:17,670 --> 00:13:22,120 And of course it travels in all directions, so we've got a 203 00:13:22,120 --> 00:13:26,540 more interesting, more complicated picture in higher 204 00:13:26,540 --> 00:13:30,370 dimensions, but we really see it here in one dimension. 205 00:13:30,370 --> 00:13:31,630 OK. 206 00:13:31,630 --> 00:13:39,120 Now I should also include a graph of the solution. 207 00:13:39,120 --> 00:13:41,000 What does the solution look like? 208 00:13:41,000 --> 00:13:46,010 Maybe I'll find a spot here for that graph. 209 00:13:46,010 --> 00:13:49,210 210 00:13:49,210 --> 00:13:51,140 Now I'm going to graph u. 211 00:13:51,140 --> 00:13:54,180 212 00:13:54,180 --> 00:13:56,270 This is still x. 213 00:13:56,270 --> 00:13:59,950 So I'll graph u at maybe two different times. 214 00:13:59,950 --> 00:14:01,650 So the starting time. 215 00:14:01,650 --> 00:14:04,280 Suppose we have a wall of water. 216 00:14:04,280 --> 00:14:07,270 217 00:14:07,270 --> 00:14:14,710 So this will be u of x and 0, a step function, maybe at 0. 218 00:14:14,710 --> 00:14:20,970 So u of x and 0 is 1 and then 0. 219 00:14:20,970 --> 00:14:22,220 OK. 220 00:14:22,220 --> 00:14:24,150 221 00:14:24,150 --> 00:14:29,060 So there's a typical starting initial value. 222 00:14:29,060 --> 00:14:32,260 223 00:14:32,260 --> 00:14:34,220 Well, I don't know if it's typical. 224 00:14:34,220 --> 00:14:36,780 Pretty special to have 1 and then 0, a 225 00:14:36,780 --> 00:14:38,030 perfect step function. 226 00:14:38,030 --> 00:14:40,530 227 00:14:40,530 --> 00:14:43,660 Now I want to ask what's the solution to the equation? 228 00:14:43,660 --> 00:14:47,600 What is u of x and t? 229 00:14:47,600 --> 00:14:50,370 I want to graph u of x and t. 230 00:14:50,370 --> 00:14:52,580 What what happens? 231 00:14:52,580 --> 00:14:58,320 You have to assemble sort of this picture, which is in the 232 00:14:58,320 --> 00:15:03,910 xt plane, into a graph here of u of x and t. 233 00:15:03,910 --> 00:15:05,390 What happens? 234 00:15:05,390 --> 00:15:10,980 Well all these 0 starting values travel along 235 00:15:10,980 --> 00:15:17,120 characteristics, and tell us that u is 0 along all these 236 00:15:17,120 --> 00:15:18,750 characteristics -- 237 00:15:18,750 --> 00:15:20,650 u is 0. 238 00:15:20,650 --> 00:15:23,740 This here, the starting value is 1. 239 00:15:23,740 --> 00:15:31,400 So along these characteristics we're starting with a 1, we 240 00:15:31,400 --> 00:15:32,290 end with a 1. 241 00:15:32,290 --> 00:15:33,780 Do you see what happens? 242 00:15:33,780 --> 00:15:37,340 243 00:15:37,340 --> 00:15:38,580 How do I graph it? 244 00:15:38,580 --> 00:15:40,530 The wave is moving. 245 00:15:40,530 --> 00:15:44,930 The wall of water is moving that way, moving to the left. 246 00:15:44,930 --> 00:15:48,080 Because I'm taking c to be a positive number. 247 00:15:48,080 --> 00:15:56,150 So u of x and t is a wall, or a wave you could say, moving 248 00:15:56,150 --> 00:16:04,270 left with speed c. 249 00:16:04,270 --> 00:16:06,780 250 00:16:06,780 --> 00:16:10,960 Every solution to the equation is doing this. 251 00:16:10,960 --> 00:16:16,360 And in this particular case it's a wall of water and it 252 00:16:16,360 --> 00:16:18,290 stays a wall of water. 253 00:16:18,290 --> 00:16:19,350 That the point. 254 00:16:19,350 --> 00:16:22,370 Shapes are not changed as we go. 255 00:16:22,370 --> 00:16:29,370 There's no dispersion would be the right word I think. 256 00:16:29,370 --> 00:16:34,030 We would expect in a general equation that the shape of the 257 00:16:34,030 --> 00:16:41,060 wave would change a little as it travels. 258 00:16:41,060 --> 00:16:43,920 In this equation it doesn't change. 259 00:16:43,920 --> 00:16:47,680 The shape stays the same. 260 00:16:47,680 --> 00:16:52,260 See again I'm thinking of this wave as a combination of pure 261 00:16:52,260 --> 00:16:53,660 exponentials. 262 00:16:53,660 --> 00:16:56,910 And they all travel with the same speed c, so the whole 263 00:16:56,910 --> 00:16:58,520 wave travels with speed c. 264 00:16:58,520 --> 00:17:05,980 And at a later time that's the graph of the solution. 265 00:17:05,980 --> 00:17:08,280 OK. 266 00:17:08,280 --> 00:17:16,040 So that much is all we have to do, all we can do really, in 267 00:17:16,040 --> 00:17:18,310 solving the differential equations. 268 00:17:18,310 --> 00:17:21,140 269 00:17:21,140 --> 00:17:22,530 It's a simple model certainly. 270 00:17:22,530 --> 00:17:25,680 But now I come to the difference equation. 271 00:17:25,680 --> 00:17:28,860 Well when I say the difference equation, I should say 272 00:17:28,860 --> 00:17:30,720 equations plural. 273 00:17:30,720 --> 00:17:35,800 Because here I've written four possibilities. 274 00:17:35,800 --> 00:17:40,990 275 00:17:40,990 --> 00:17:45,870 Three of them are actually used, and one is a disaster. 276 00:17:45,870 --> 00:17:52,640 277 00:17:52,640 --> 00:17:56,860 But none of the four is perfect. 278 00:17:56,860 --> 00:18:00,200 Most people would say Lax-Wendroff is the best of 279 00:18:00,200 --> 00:18:06,250 these four, because it has one extra order of accuracy. 280 00:18:06,250 --> 00:18:09,500 281 00:18:09,500 --> 00:18:11,100 Oh yeah, yeah. 282 00:18:11,100 --> 00:18:14,350 I guess these all have only first order accuracy. 283 00:18:14,350 --> 00:18:17,160 284 00:18:17,160 --> 00:18:19,200 But Lax-Wendroff moves up to second. 285 00:18:19,200 --> 00:18:24,680 So that's a method that everybody knows, because it 286 00:18:24,680 --> 00:18:25,650 gets up this way. 287 00:18:25,650 --> 00:18:29,860 But actually upwind is the first one to start with. 288 00:18:29,860 --> 00:18:32,120 Let me start with that one. 289 00:18:32,120 --> 00:18:33,060 OK. 290 00:18:33,060 --> 00:18:38,460 So I've multiplied up by the delta t that should be in the 291 00:18:38,460 --> 00:18:40,140 denominator there. 292 00:18:40,140 --> 00:18:48,620 293 00:18:48,620 --> 00:18:51,580 I'm taking the standard forward difference in time -- 294 00:18:51,580 --> 00:18:55,930 all these methods are going to be explicit , so they're all 295 00:18:55,930 --> 00:19:01,120 going to be solvable in a simple way for 296 00:19:01,120 --> 00:19:03,400 u at the new time. 297 00:19:03,400 --> 00:19:09,550 So a forward difference in time for du, dt and c times a 298 00:19:09,550 --> 00:19:12,450 forward difference in space for du, da. 299 00:19:12,450 --> 00:19:17,110 So that's the first idea that would occur to you, and it's 300 00:19:17,110 --> 00:19:19,980 pretty reasonable. 301 00:19:19,980 --> 00:19:22,460 We can check its accuracy, but you can guess 302 00:19:22,460 --> 00:19:24,480 what it would be. 303 00:19:24,480 --> 00:19:29,070 What's your guess on the accuracy of this method? 304 00:19:29,070 --> 00:19:32,520 You're seeing a forward difference in time, a forward 305 00:19:32,520 --> 00:19:34,360 difference in space. 306 00:19:34,360 --> 00:19:38,440 The odds are those finite differences give you an 307 00:19:38,440 --> 00:19:43,700 accuracy p, if we use p as the measure of accuracy, which 308 00:19:43,700 --> 00:19:50,580 would be probably 1, first order accurate. 309 00:19:50,580 --> 00:19:55,500 So we'll see the accuracy as only p equal to 1. 310 00:19:55,500 --> 00:19:57,680 OK. 311 00:19:57,680 --> 00:20:00,290 What about the stability? 312 00:20:00,290 --> 00:20:02,090 I'm looking at this first method. 313 00:20:02,090 --> 00:20:05,130 314 00:20:05,130 --> 00:20:09,550 So one comment about the method is that this ratio c 315 00:20:09,550 --> 00:20:18,780 delta t over delta x, let me call it r, 316 00:20:18,780 --> 00:20:20,830 that's a key number. 317 00:20:20,830 --> 00:20:28,350 it's called the Courant number by some. 318 00:20:28,350 --> 00:20:32,010 319 00:20:32,010 --> 00:20:35,660 So in the literature you might see the phrase Courant number 320 00:20:35,660 --> 00:20:38,000 for that ratio r. 321 00:20:38,000 --> 00:20:44,270 And maybe my first point is stability is going to put a 322 00:20:44,270 --> 00:20:47,020 bound on r. 323 00:20:47,020 --> 00:20:50,930 We can tell right away for this explicit method and for 324 00:20:50,930 --> 00:20:58,030 any explicit method, that r can't be unlimited. 325 00:20:58,030 --> 00:21:02,985 There's going to be a bound on r, which it means a 326 00:21:02,985 --> 00:21:04,180 bound on delta t. 327 00:21:04,180 --> 00:21:09,110 It's telling us that delta t has to be less than some 328 00:21:09,110 --> 00:21:12,820 constant times delta x. 329 00:21:12,820 --> 00:21:17,240 And stability is the job to find that constant. 330 00:21:17,240 --> 00:21:20,060 How small does delta t have to be? 331 00:21:20,060 --> 00:21:25,780 Now let me sort of understand this forward difference method 332 00:21:25,780 --> 00:21:28,210 in this picture. 333 00:21:28,210 --> 00:21:30,740 334 00:21:30,740 --> 00:21:37,180 So I'm going to do the forward difference, delta t of u 335 00:21:37,180 --> 00:21:44,270 equals that ratio times the forward difference of the 336 00:21:44,270 --> 00:21:46,980 space difference, so time differences is that ratio 337 00:21:46,980 --> 00:21:48,620 times this space difference. 338 00:21:48,620 --> 00:21:49,440 OK. 339 00:21:49,440 --> 00:21:51,850 Method 1. 340 00:21:51,850 --> 00:21:53,520 OK. 341 00:21:53,520 --> 00:22:02,990 So I guess somehow you want to see want to see a picture like 342 00:22:02,990 --> 00:22:06,160 this for the difference equation, So the difference 343 00:22:06,160 --> 00:22:16,150 equation we imagine we've got steps delta x, all these steps 344 00:22:16,150 --> 00:22:16,965 are delta x. 345 00:22:16,965 --> 00:22:19,420 Let's suppose that's 0. 346 00:22:19,420 --> 00:22:20,710 OK. 347 00:22:20,710 --> 00:22:25,380 So what happening now, and time going this way and I'm 348 00:22:25,380 --> 00:22:27,460 solving this equation? 349 00:22:27,460 --> 00:22:28,710 What's happening here? 350 00:22:28,710 --> 00:22:36,390 351 00:22:36,390 --> 00:22:43,790 Let me copy this method, u at a position j, so this might be 352 00:22:43,790 --> 00:22:52,230 the point j delta x, at time n plus 1 is. 353 00:22:52,230 --> 00:22:55,130 I want to write this equation as always in the most 354 00:22:55,130 --> 00:22:56,640 convenient way. 355 00:22:56,640 --> 00:22:58,120 So what am I going to do? 356 00:22:58,120 --> 00:23:00,800 I'm going to take this u of x and t and put it 357 00:23:00,800 --> 00:23:03,450 on the right hand. 358 00:23:03,450 --> 00:23:11,710 So then my equation looks like that ratio r times u at j plus 359 00:23:11,710 --> 00:23:13,790 1 at time n. 360 00:23:13,790 --> 00:23:16,640 That's this. 361 00:23:16,640 --> 00:23:24,120 I'm one position over, but I'm at the given time. 362 00:23:24,120 --> 00:23:27,300 And then what's the coefficient of ujn? 363 00:23:27,300 --> 00:23:30,160 364 00:23:30,160 --> 00:23:33,470 So can you just tell me what do I put in there? 365 00:23:33,470 --> 00:23:35,620 So this will be that nice way to look at 366 00:23:35,620 --> 00:23:38,070 our difference equation. 367 00:23:38,070 --> 00:23:42,960 Each new value is a combination of two old values, 368 00:23:42,960 --> 00:23:47,570 r times the guy here. 369 00:23:47,570 --> 00:23:50,200 So in other words, here's my little molecule. 370 00:23:50,200 --> 00:23:52,720 371 00:23:52,720 --> 00:23:58,700 This is the new value it comes from r times this plus what, 372 00:23:58,700 --> 00:24:01,600 you have to tell me what multiplies 373 00:24:01,600 --> 00:24:03,350 this you at this point. 374 00:24:03,350 --> 00:24:08,620 So here's uj n plus 1, and here's uj plus 375 00:24:08,620 --> 00:24:11,410 1n, and here is ujn. 376 00:24:11,410 --> 00:24:14,340 And what goes in parentheses? 377 00:24:14,340 --> 00:24:16,660 1 minus o. 378 00:24:16,660 --> 00:24:23,020 Because I get the 1 when that flips over to the other side. 379 00:24:23,020 --> 00:24:24,120 Good. 380 00:24:24,120 --> 00:24:26,560 So it's just a combination. 381 00:24:26,560 --> 00:24:29,030 The new value is a combination of those two. 382 00:24:29,030 --> 00:24:31,790 383 00:24:31,790 --> 00:24:40,520 And I guess what I want to show is that it could not 384 00:24:40,520 --> 00:24:48,360 possibly be stable unless r is less or equal to 1. 385 00:24:48,360 --> 00:24:51,250 So this will be the Courant condition. 386 00:24:51,250 --> 00:24:54,310 The condition on the Courant number. 387 00:24:54,310 --> 00:25:01,320 So the Courant condition or the CFL, that's a really a 388 00:25:01,320 --> 00:25:03,300 better condition. 389 00:25:03,300 --> 00:25:07,230 390 00:25:07,230 --> 00:25:08,890 Let me say what it is. 391 00:25:08,890 --> 00:25:14,980 The CFL condition is r less or equal to 1. 392 00:25:14,980 --> 00:25:21,790 That's a condition for stability or convergence that 393 00:25:21,790 --> 00:25:29,250 comes to us from comparing the real characteristics with the 394 00:25:29,250 --> 00:25:31,630 finite difference picture. 395 00:25:31,630 --> 00:25:31,960 OK. 396 00:25:31,960 --> 00:25:33,920 So what's CFL? 397 00:25:33,920 --> 00:25:35,260 C is Courant still. 398 00:25:35,260 --> 00:25:41,120 So the this came from a really early paper, and I think 399 00:25:41,120 --> 00:25:43,850 actually Lewy. 400 00:25:43,850 --> 00:25:46,170 That's Courant, that's Friedrichs, 401 00:25:46,170 --> 00:25:47,930 they were close friends. 402 00:25:47,930 --> 00:25:51,330 That's Lewy, all three were friends actually. 403 00:25:51,330 --> 00:25:58,110 And I think it was actually Lewy who spotted what we're 404 00:25:58,110 --> 00:26:02,770 just going to do right now, the requirement that r had to 405 00:26:02,770 --> 00:26:04,020 be less or equal 1. 406 00:26:04,020 --> 00:26:06,700 407 00:26:06,700 --> 00:26:12,620 Now let me just make clear that this 408 00:26:12,620 --> 00:26:15,430 Courant-Friedrichs-Lewy condition is going to be a 409 00:26:15,430 --> 00:26:16,770 necessary condition. 410 00:26:16,770 --> 00:26:21,050 It has to hold or there is no hope. 411 00:26:21,050 --> 00:26:27,780 But it's not enough, it's not a sufficient condition. 412 00:26:27,780 --> 00:26:33,370 We can't guarantee that a method stable just because the 413 00:26:33,370 --> 00:26:35,670 Courant condition is satisfied. 414 00:26:35,670 --> 00:26:38,230 The Courant condition will tell us something about the 415 00:26:38,230 --> 00:26:43,220 position of characteristics, we'll see it in a second. 416 00:26:43,220 --> 00:26:50,430 For example, this centered one is unstable, this guy when the 417 00:26:50,430 --> 00:26:54,640 right hand side you might say, oh this is a better method; 418 00:26:54,640 --> 00:26:57,850 always better to take a center difference for du 419 00:26:57,850 --> 00:26:59,680 dx than a one sided. 420 00:26:59,680 --> 00:27:02,680 But not now. 421 00:27:02,680 --> 00:27:06,790 The one sided one d OK. 422 00:27:06,790 --> 00:27:17,200 The centered one is going to be totally unstable for all r, 423 00:27:17,200 --> 00:27:19,470 this centered one. 424 00:27:19,470 --> 00:27:25,600 And we'll identify that not from Courant-Friedrichs-Lewy 425 00:27:25,600 --> 00:27:28,540 their paper wouldn't have spotted the difference between 426 00:27:28,540 --> 00:27:33,550 one and two, but van Neumann did; van Neumann quickly 427 00:27:33,550 --> 00:27:38,950 noticed that if you use an exponential, so we'll do one 428 00:27:38,950 --> 00:27:43,560 van Neumann in a moment, if you plug in an exponential the 429 00:27:43,560 --> 00:27:47,440 number 2, this center difference, it takes off. 430 00:27:47,440 --> 00:27:51,670 And it's unstable even if delta t is small. 431 00:27:51,670 --> 00:27:52,400 OK. 432 00:27:52,400 --> 00:27:55,000 Now what is this CFL, 433 00:27:55,000 --> 00:27:56,500 Courant-Friedrichs-Lewy, condition? 434 00:27:56,500 --> 00:27:59,960 Where does that come from? 435 00:27:59,960 --> 00:28:04,790 It comes from just thinking about the information. 436 00:28:04,790 --> 00:28:08,850 437 00:28:08,850 --> 00:28:11,250 I have to write down the thinking now that goes into 438 00:28:11,250 --> 00:28:17,930 the Courant-Friedrichs-Lewy condition, the CFL condition. 439 00:28:17,930 --> 00:28:24,920 440 00:28:24,920 --> 00:28:26,640 OK. 441 00:28:26,640 --> 00:28:29,710 It's straightforward. 442 00:28:29,710 --> 00:28:42,110 I have to think at a time t, let's say t equals n delta t. 443 00:28:42,110 --> 00:28:54,120 Suppose I've taken n times that, then the true u at, 444 00:28:54,120 --> 00:29:01,050 let's say, 0 and that time t is, or x and t because we know 445 00:29:01,050 --> 00:29:08,140 the true solution, the true u at x and t is as we know the 446 00:29:08,140 --> 00:29:17,080 initial function x plus ct at the point x plus ct. 447 00:29:17,080 --> 00:29:22,780 So that's the correct solution. 448 00:29:22,780 --> 00:29:27,780 And Courant-Friedrichs-Lewy are just saying that you 449 00:29:27,780 --> 00:29:35,730 better use this number in finding a difference method or 450 00:29:35,730 --> 00:29:39,000 you don't have a chance. 451 00:29:39,000 --> 00:29:39,210 Right. 452 00:29:39,210 --> 00:29:42,240 That makes sense. 453 00:29:42,240 --> 00:29:46,450 So what do I mean by use this number? 454 00:29:46,450 --> 00:29:46,790 OK. 455 00:29:46,790 --> 00:29:48,450 So let me draw. 456 00:29:48,450 --> 00:29:52,110 So u at x and t is some point here. 457 00:29:52,110 --> 00:29:54,540 This is at the point x and t. 458 00:29:54,540 --> 00:29:57,010 This use these two values. 459 00:29:57,010 --> 00:30:00,350 They use these three values. 460 00:30:00,350 --> 00:30:02,620 This one use that one, that one, that one. 461 00:30:02,620 --> 00:30:04,800 This one use those two. 462 00:30:04,800 --> 00:30:08,890 Those four use these five values. 463 00:30:08,890 --> 00:30:10,140 Right. 464 00:30:10,140 --> 00:30:15,470 465 00:30:15,470 --> 00:30:18,700 See the difference method is not propagating the 466 00:30:18,700 --> 00:30:25,770 information entirely on that line, it's really taking 467 00:30:25,770 --> 00:30:28,510 values over that whole interval with some 468 00:30:28,510 --> 00:30:31,520 combinations of r and 1 minus r. 469 00:30:31,520 --> 00:30:34,570 And in the end after five times step, it's giving us 470 00:30:34,570 --> 00:30:37,950 this value up there. 471 00:30:37,950 --> 00:30:46,700 But the point is that if this point x plus ct were out here, 472 00:30:46,700 --> 00:30:51,500 then refining delta x an refining dealt t, and using 473 00:30:51,500 --> 00:30:54,540 more and more point and filling in and using more of 474 00:30:54,540 --> 00:30:57,740 these, but not getting out here, would 475 00:30:57,740 --> 00:30:58,900 get you know where. 476 00:30:58,900 --> 00:31:00,410 You wouldn't have a chance. 477 00:31:00,410 --> 00:31:01,020 So that's the 478 00:31:01,020 --> 00:31:02,870 Courant-Friedrichs-Lewy condition. 479 00:31:02,870 --> 00:31:05,010 How far out is this? 480 00:31:05,010 --> 00:31:09,240 This is n delta x inside this. 481 00:31:09,240 --> 00:31:15,080 And if this is x, this is n delta x is away, and 482 00:31:15,080 --> 00:31:18,520 this is x plus ct. 483 00:31:18,520 --> 00:31:20,470 And c is n delta t's. 484 00:31:20,470 --> 00:31:24,890 485 00:31:24,890 --> 00:31:26,390 Right? 486 00:31:26,390 --> 00:31:33,150 t is n delta t. 487 00:31:33,150 --> 00:31:34,400 Are you with me? 488 00:31:34,400 --> 00:31:38,690 489 00:31:38,690 --> 00:31:44,910 As I keep delta t over delta x, the ratio r fixed and use 490 00:31:44,910 --> 00:31:50,400 more and more points, I'm filling up this interval with 491 00:31:50,400 --> 00:31:53,100 points that I've used. 492 00:31:53,100 --> 00:31:56,590 But I'm never going to get to a point there. 493 00:31:56,590 --> 00:32:02,050 So the idea is then unstable, couldn't 494 00:32:02,050 --> 00:32:04,330 converge, couldn't work. 495 00:32:04,330 --> 00:32:11,400 496 00:32:11,400 --> 00:32:18,990 If the distance reached here n delta x is smaller than cn 497 00:32:18,990 --> 00:32:24,410 delta t, it couldn't work. 498 00:32:24,410 --> 00:32:26,910 OK. 499 00:32:26,910 --> 00:32:28,830 So I'm taking a negative point of view here. 500 00:32:28,830 --> 00:32:32,860 It can't work in this case. 501 00:32:32,860 --> 00:32:35,510 The reason I take that negative point of view is I'm 502 00:32:35,510 --> 00:32:43,060 not able to say it does work in the case when delta x is 503 00:32:43,060 --> 00:32:46,060 big enough compared to delta t, and I include that point. 504 00:32:46,060 --> 00:32:47,330 I can't be sure. 505 00:32:47,330 --> 00:32:50,640 But I can be sure that if I don't include that 506 00:32:50,640 --> 00:32:56,630 neighborhood of where the true u is produce, it 507 00:32:56,630 --> 00:32:57,530 can't have a chance. 508 00:32:57,530 --> 00:33:02,100 So let me just cancel n divide by delta x. 509 00:33:02,100 --> 00:33:10,440 And I say fail if 1 is smaller then c delta t over delta x 510 00:33:10,440 --> 00:33:11,120 which is r. 511 00:33:11,120 --> 00:33:20,330 It fails if r is bigger than 1 by this reasoning of 512 00:33:20,330 --> 00:33:21,580 characteristics. 513 00:33:21,580 --> 00:33:25,880 514 00:33:25,880 --> 00:33:29,090 There are two more cases that are worth thinking about. 515 00:33:29,090 --> 00:33:37,100 Suppose the method was down wind. 516 00:33:37,100 --> 00:33:41,320 So this is up wind, because I take a forward difference. 517 00:33:41,320 --> 00:33:44,580 The wind is blowing this way. 518 00:33:44,580 --> 00:33:52,200 Forgive me for incomplete use of the word wind. 519 00:33:52,200 --> 00:33:53,640 I don't know what it means. 520 00:33:53,640 --> 00:33:56,460 But one way or another whatever, the wind is 521 00:33:56,460 --> 00:33:57,980 blowing this way. 522 00:33:57,980 --> 00:34:02,040 The values are coming from the up wind direction. 523 00:34:02,040 --> 00:34:05,280 And that's good, because the true value comes from the up 524 00:34:05,280 --> 00:34:06,640 wind direction. 525 00:34:06,640 --> 00:34:10,190 That's what we saw on characteristics, the values 526 00:34:10,190 --> 00:34:12,160 are blowing down wind. 527 00:34:12,160 --> 00:34:17,410 So what would happen if I use a backward difference here? 528 00:34:17,410 --> 00:34:21,760 So I didn't write that bad idea, but it's important to 529 00:34:21,760 --> 00:34:26,510 realizes that's method 1a. 530 00:34:26,510 --> 00:34:31,060 A bad idea is to use a backward difference here. 531 00:34:31,060 --> 00:34:35,880 I should maybe call it 1b for backward. 532 00:34:35,880 --> 00:34:38,000 You see that it would fail? 533 00:34:38,000 --> 00:34:40,520 If I used a backward difference, what will what 534 00:34:40,520 --> 00:34:42,000 happen to this picture? 535 00:34:42,000 --> 00:34:45,110 This value would come from stuff on the left. 536 00:34:45,110 --> 00:34:49,900 It would totally have no chance to use the correct 537 00:34:49,900 --> 00:34:51,730 initial value. 538 00:34:51,730 --> 00:34:54,770 So a backward difference is an immediate failure. 539 00:34:54,770 --> 00:35:00,880 540 00:35:00,880 --> 00:35:05,500 It will also fail if -- 541 00:35:05,500 --> 00:35:09,360 well I was going to say r less than 0. 542 00:35:09,360 --> 00:35:12,460 I don't know whether I can say that. 543 00:35:12,460 --> 00:35:16,030 The way r could be less than 0 would be the delta x being 544 00:35:16,030 --> 00:35:21,360 negative, and that's what I mean by the down wind message, 545 00:35:21,360 --> 00:35:26,800 where I'm looking for looking for the value here, and of 546 00:35:26,800 --> 00:35:28,590 course I'm not finding it. 547 00:35:28,590 --> 00:35:30,510 OK. 548 00:35:30,510 --> 00:35:35,850 So I guess I'm saying that Courant-Friedrichs-Lewy tells 549 00:35:35,850 --> 00:35:49,020 us right away that this method will only be possible, And in 550 00:35:49,020 --> 00:35:52,250 fact this is the stability condition. 551 00:35:52,250 --> 00:35:56,290 So let me write that fact, but we haven't proved it yet. 552 00:35:56,290 --> 00:36:00,970 It's stable for r between 0 and 1. 553 00:36:00,970 --> 00:36:04,220 That's the stability condition, which 554 00:36:04,220 --> 00:36:07,250 limits delta t. 555 00:36:07,250 --> 00:36:12,650 Because r is delta t over delta x. 556 00:36:12,650 --> 00:36:17,260 And this says that delta t can't be larger than the 557 00:36:17,260 --> 00:36:19,170 multiple of delta x. 558 00:36:19,170 --> 00:36:19,510 OK. 559 00:36:19,510 --> 00:36:25,910 You might say that sounds like delta t is too small. 560 00:36:25,910 --> 00:36:28,360 Is stability too restrictive? 561 00:36:28,360 --> 00:36:30,830 Well it's restrictive certainly, because it 562 00:36:30,830 --> 00:36:32,560 limits delta t. 563 00:36:32,560 --> 00:36:39,920 But actually for these methods, accuracy also 564 00:36:39,920 --> 00:36:40,980 limits delta t. 565 00:36:40,980 --> 00:36:56,380 If I look for a method that allowed a bigger delta t, then 566 00:36:56,380 --> 00:37:00,920 the error of that in that method proportional to delta t 567 00:37:00,920 --> 00:37:01,960 would be too big. 568 00:37:01,960 --> 00:37:07,800 In other words accuracy as well as stability is keeping 569 00:37:07,800 --> 00:37:10,470 delta t of the order of delta x. 570 00:37:10,470 --> 00:37:17,430 Accuracy as well as stability is keeping r within a bound, 571 00:37:17,430 --> 00:37:21,230 and stability is keeping it within those bounds. 572 00:37:21,230 --> 00:37:22,490 OK. 573 00:37:22,490 --> 00:37:26,700 So I still have to show that the method is stable. 574 00:37:26,700 --> 00:37:30,790 The Courant-Friedrichs-Lewy condition just helps to 575 00:37:30,790 --> 00:37:35,760 eliminate impossible ratios. 576 00:37:35,760 --> 00:37:36,680 OK. 577 00:37:36,680 --> 00:37:41,895 One more point, which of course everybody notices in 578 00:37:41,895 --> 00:37:46,870 solving the difference equation. 579 00:37:46,870 --> 00:37:50,960 Suppose r is exactly 1? 580 00:37:50,960 --> 00:37:53,710 Think about the case where r is exactly 1. 581 00:37:53,710 --> 00:37:58,080 582 00:37:58,080 --> 00:38:00,550 Remember that's c delta t over delta x. 583 00:38:00,550 --> 00:38:06,650 584 00:38:06,650 --> 00:38:12,400 Suppose r is exactly 1, then what does the method do? 585 00:38:12,400 --> 00:38:16,190 The method takes the new value, r is 1. 586 00:38:16,190 --> 00:38:18,140 This is 0 now. 587 00:38:18,140 --> 00:38:22,840 So the new value is then when r is 1 is that old value. 588 00:38:22,840 --> 00:38:28,880 In this picture, when r is 1 this value is this one. 589 00:38:28,880 --> 00:38:34,300 The values are traveling along a line. 590 00:38:34,300 --> 00:38:39,150 I'm not using these you see, because if r is exactly 1, 591 00:38:39,150 --> 00:38:42,990 these are exactly 0. 592 00:38:42,990 --> 00:38:45,100 Now is that good? 593 00:38:45,100 --> 00:38:50,780 Actually it's terrific, because that line when r is 1 594 00:38:50,780 --> 00:38:55,210 is the correct characteristic line. 595 00:38:55,210 --> 00:39:01,390 If r is 1, if c delta t equals delta x, I'm going up exactly 596 00:39:01,390 --> 00:39:06,040 with that slope that the true line does. 597 00:39:06,040 --> 00:39:12,660 In other words, the difference equation is gives exactly the 598 00:39:12,660 --> 00:39:14,900 solution to the differential equation. 599 00:39:14,900 --> 00:39:17,510 Because it's so simple of course. 600 00:39:17,510 --> 00:39:18,920 Couldn't do it. 601 00:39:18,920 --> 00:39:24,970 Well that's the point, we can't do it for big problems, 602 00:39:24,970 --> 00:39:30,900 because in a big problem c is going to be variable. 603 00:39:30,900 --> 00:39:33,830 Maybe the problem we'll receive may depend on the 604 00:39:33,830 --> 00:39:38,270 position or the time, or it might depend on the solution u 605 00:39:38,270 --> 00:39:40,420 in a non-linear problem. 606 00:39:40,420 --> 00:39:42,460 Those are ahead of us. 607 00:39:42,460 --> 00:39:45,920 But there's possibility in 1D. 608 00:39:45,920 --> 00:39:50,210 It's only a really a one dimensional possibility, where 609 00:39:50,210 --> 00:39:53,980 the true information travels on a line, and we could just 610 00:39:53,980 --> 00:39:57,590 hope to stay close to that characteristic line. 611 00:39:57,590 --> 00:39:58,840 OK. 612 00:39:58,840 --> 00:40:01,340 613 00:40:01,340 --> 00:40:08,770 Now I'm ready to tackle for any method. 614 00:40:08,770 --> 00:40:10,750 Let me get these guys up again. 615 00:40:10,750 --> 00:40:13,980 616 00:40:13,980 --> 00:40:19,110 So first I want to see why is up wind stable, and why is 617 00:40:19,110 --> 00:40:22,070 centered unstable. 618 00:40:22,070 --> 00:40:25,480 Should I start with the stability question rather than 619 00:40:25,480 --> 00:40:27,360 the accuracy question? 620 00:40:27,360 --> 00:40:32,240 Yeah, Christie we could guess what's first order until we 621 00:40:32,240 --> 00:40:33,440 get to Lax-Wendroff. 622 00:40:33,440 --> 00:40:36,900 So accuracy is going to come next time. 623 00:40:36,900 --> 00:40:40,410 624 00:40:40,410 --> 00:40:46,450 We've had Courants take on stability, the CFO condition, 625 00:40:46,450 --> 00:40:52,210 but now I'm ready for van Neumann's deeper insight. 626 00:40:52,210 --> 00:40:52,560 OK. 627 00:40:52,560 --> 00:40:55,940 So how does von Neumann study stability? 628 00:40:55,940 --> 00:40:58,580 He watches every e to the ikx. 629 00:40:58,580 --> 00:41:01,400 630 00:41:01,400 --> 00:41:06,160 So von Neumann's is going to be each e to the ikx should 631 00:41:06,160 --> 00:41:11,830 have a growth factor in the difference equation 632 00:41:11,830 --> 00:41:14,840 smaller then 1. 633 00:41:14,840 --> 00:41:18,470 The growth factor in the differential equation of 634 00:41:18,470 --> 00:41:22,670 course was right on. 635 00:41:22,670 --> 00:41:27,960 This has magnitude exactly 1. 636 00:41:27,960 --> 00:41:31,660 So wave equations are not giving us any 637 00:41:31,660 --> 00:41:34,130 space to work in. 638 00:41:34,130 --> 00:41:36,500 Because we want the growth factor and the difference 639 00:41:36,500 --> 00:41:39,560 equation, we want it to be close to the real 1. 640 00:41:39,560 --> 00:41:46,280 And at the same time it better be not the real 1 having 641 00:41:46,280 --> 00:41:50,710 absolute value exactly 1 on the unit circle. 642 00:41:50,710 --> 00:41:55,280 But the difference equation is allowed to go into the unit 643 00:41:55,280 --> 00:41:57,030 circle, but not to go out. 644 00:41:57,030 --> 00:41:57,540 OK. 645 00:41:57,540 --> 00:42:01,790 That will separate the good ones from the bad. 646 00:42:01,790 --> 00:42:02,440 OK. 647 00:42:02,440 --> 00:42:04,310 Let me work here. 648 00:42:04,310 --> 00:42:09,040 649 00:42:09,040 --> 00:42:17,250 Can I copy the equation uj n plus 1 is equal to r uj plus 650 00:42:17,250 --> 00:42:23,510 1n, and 1 minus r ujn. 651 00:42:23,510 --> 00:42:24,710 OK. 652 00:42:24,710 --> 00:42:28,830 Now I'm going to do an exponential again. 653 00:42:28,830 --> 00:42:39,610 654 00:42:39,610 --> 00:42:43,590 I'm going to start from e to the ikx. 655 00:42:43,590 --> 00:42:48,470 656 00:42:48,470 --> 00:43:01,970 Sorry, let me say times 0 and position n will be e to the 657 00:43:01,970 --> 00:43:06,930 ikn delta x. 658 00:43:06,930 --> 00:43:07,390 Right. 659 00:43:07,390 --> 00:43:14,100 That's my initial, e to the ikx, that's my pure frequency. 660 00:43:14,100 --> 00:43:18,040 I plug that in. 661 00:43:18,040 --> 00:43:24,400 Oh not n but j; j is measuring how many, sorry let's get it 662 00:43:24,400 --> 00:43:30,400 right; j is measuring how many delta x's I'm going across; n 663 00:43:30,400 --> 00:43:32,960 is measuring how many delta t's I'm going up. 664 00:43:32,960 --> 00:43:34,900 So this is the key, here's von Neumann. 665 00:43:34,900 --> 00:43:38,520 666 00:43:38,520 --> 00:43:43,000 Try a pure exponential, plug it in. 667 00:43:43,000 --> 00:43:46,570 Again it's going to work, because we have constant 668 00:43:46,570 --> 00:43:47,610 coefficients. 669 00:43:47,610 --> 00:43:49,980 So what do I get on the right hand side? 670 00:43:49,980 --> 00:43:58,870 I get r times this guy at level j plus 1, e to the ik j 671 00:43:58,870 --> 00:44:06,510 plus 1 delta x times the exponential. 672 00:44:06,510 --> 00:44:08,500 Can I save the exponential because it's 673 00:44:08,500 --> 00:44:11,970 going to factor out. 674 00:44:11,970 --> 00:44:17,220 Plus a 1 minus 4 times the exponential itself, and here's 675 00:44:17,220 --> 00:44:22,170 the exponential: e to the ikj delta x. 676 00:44:22,170 --> 00:44:24,840 This will be one step. 677 00:44:24,840 --> 00:44:37,900 I could say uj1 coming from level 0 to level 1. 678 00:44:37,900 --> 00:44:45,290 Sorry e to the ikj delta x, so I don't need it here. 679 00:44:45,290 --> 00:44:46,780 Sorry I did it wrong. 680 00:44:46,780 --> 00:44:54,100 That e to the ikj plus 1 delta x factors into e to the ik 681 00:44:54,100 --> 00:44:58,810 delta x from the 1, and e to the ikj delta x, 682 00:44:58,810 --> 00:44:59,720 which is over there. 683 00:44:59,720 --> 00:45:01,670 So I only wanted this much. 684 00:45:01,670 --> 00:45:07,200 685 00:45:07,200 --> 00:45:08,450 OK. 686 00:45:08,450 --> 00:45:12,530 687 00:45:12,530 --> 00:45:17,340 Sorry that's on the permanent tape but maybe it's OK. 688 00:45:17,340 --> 00:45:23,440 Because it makes us think through what's the result from 689 00:45:23,440 --> 00:45:24,820 a pure exponential? 690 00:45:24,820 --> 00:45:29,420 And again the result is pure exponential in, pure 691 00:45:29,420 --> 00:45:33,940 exponential out, but multiply by some finite difference 692 00:45:33,940 --> 00:45:38,750 growth factor g, that depends on the frequency. 693 00:45:38,750 --> 00:45:44,470 And it depends delta x and it depends on r. 694 00:45:44,470 --> 00:45:50,400 695 00:45:50,400 --> 00:45:53,520 Well actually it depends on k delta x together. 696 00:45:53,520 --> 00:45:54,880 So I could put that together. 697 00:45:54,880 --> 00:46:01,530 698 00:46:01,530 --> 00:46:05,120 What's von Neumann's question now? 699 00:46:05,120 --> 00:46:08,720 He wants to know is this number, it's a complex a 700 00:46:08,720 --> 00:46:12,920 number of course because it's got this cosine of k dealt x 701 00:46:12,920 --> 00:46:20,120 plus i sign of k delta x, he wants to know is it magnitude. 702 00:46:20,120 --> 00:46:23,460 Does the magnitude get bigger than 1? 703 00:46:23,460 --> 00:46:29,140 if so n steps will give the nth power of the thing and it 704 00:46:29,140 --> 00:46:33,790 will blow up, or does the magnitude stay lesser equal to 705 00:46:33,790 --> 00:46:39,530 1, in which case it won't blow up, in which 706 00:46:39,530 --> 00:46:42,770 case we have stability. 707 00:46:42,770 --> 00:46:46,610 Of course it would be great if the magnitude was 708 00:46:46,610 --> 00:46:49,100 always exactly 1. 709 00:46:49,100 --> 00:46:53,520 Because that's what the true solution has. 710 00:46:53,520 --> 00:46:58,390 But that's only going to happen in this special, 711 00:46:58,390 --> 00:47:03,050 special case when r equals 1, and I'm going just right on 712 00:47:03,050 --> 00:47:04,510 the characteristic. 713 00:47:04,510 --> 00:47:08,310 When r is exactly 1, that's the case when that's gone, 714 00:47:08,310 --> 00:47:11,730 this is a 1, and that has magnitude exactly 1. 715 00:47:11,730 --> 00:47:16,070 But normally r is going to be, I'm going to be on the safe 716 00:47:16,070 --> 00:47:18,110 side, r will be less than 1. 717 00:47:18,110 --> 00:47:23,910 And I just want to draw this van Neumann 718 00:47:23,910 --> 00:47:26,000 amplification factor. 719 00:47:26,000 --> 00:47:28,750 I'll often use the word growth factor just because it's 720 00:47:28,750 --> 00:47:32,360 shorter, but another word is amplification factor. 721 00:47:32,360 --> 00:47:35,630 What does an exponential get amplified by? 722 00:47:35,630 --> 00:47:41,300 Can you identify this number in the complex plane? 723 00:47:41,300 --> 00:47:45,180 Of course the big question is where is it with respect to 724 00:47:45,180 --> 00:47:47,300 the unit circle? 725 00:47:47,300 --> 00:47:48,240 OK. 726 00:47:48,240 --> 00:47:50,280 Take k equals 0 -- 727 00:47:50,280 --> 00:47:55,110 0 frequency the DC term, the constant start -- what is that 728 00:47:55,110 --> 00:47:57,340 number equal when k is 0? 729 00:47:57,340 --> 00:48:00,320 730 00:48:00,320 --> 00:48:01,570 1. 731 00:48:01,570 --> 00:48:07,690 So that's normal that k equals 0. 732 00:48:07,690 --> 00:48:10,050 We're right at the position 1. 733 00:48:10,050 --> 00:48:12,670 That's just telling us that a constant 734 00:48:12,670 --> 00:48:17,060 initial value stays unchanged. 735 00:48:17,060 --> 00:48:20,420 The true growth factor and the van Neumann amplification 736 00:48:20,420 --> 00:48:22,400 factor both 1. 737 00:48:22,400 --> 00:48:27,680 But now let k be non-0. 738 00:48:27,680 --> 00:48:30,200 Where is this complex number? 739 00:48:30,200 --> 00:48:33,710 And now I'm going to impose the condition that r is 740 00:48:33,710 --> 00:48:46,470 between 0 and 1, because I know from Courant that is 741 00:48:46,470 --> 00:48:47,920 going to be required. 742 00:48:47,920 --> 00:48:49,040 What's the point here? 743 00:48:49,040 --> 00:48:49,750 OK. 744 00:48:49,750 --> 00:48:53,050 Then you see here is a 1 minus r. 745 00:48:53,050 --> 00:48:56,050 746 00:48:56,050 --> 00:49:00,540 So there's 1, 1 minus r will be a little bit in here, and 747 00:49:00,540 --> 00:49:03,330 then what happens when I add on this number? 748 00:49:03,330 --> 00:49:05,750 So the 1 minus r I've done. 749 00:49:05,750 --> 00:49:07,080 It put me here. 750 00:49:07,080 --> 00:49:08,610 It was real. 751 00:49:08,610 --> 00:49:10,250 But this number is not real. 752 00:49:10,250 --> 00:49:16,280 This just number is r times complex number, 753 00:49:16,280 --> 00:49:17,050 but what do I know? 754 00:49:17,050 --> 00:49:19,360 I do something critical here. 755 00:49:19,360 --> 00:49:22,930 What do I know about this number? 756 00:49:22,930 --> 00:49:25,920 I know its absolute value is 1. 757 00:49:25,920 --> 00:49:28,600 So that it gets multiplied by an r. 758 00:49:28,600 --> 00:49:31,860 Look, look, look, look. 759 00:49:31,860 --> 00:49:33,490 I start with a 1 minus r. 760 00:49:33,490 --> 00:49:37,960 So I go to 1 back to r, and now I add in this part, which 761 00:49:37,960 --> 00:49:43,880 is somewhere on a circle, a radius r that's everything in 762 00:49:43,880 --> 00:49:46,360 this problem. 763 00:49:46,360 --> 00:49:53,140 It's a circle of radius r around the point 1 minus r. 764 00:49:53,140 --> 00:49:58,170 765 00:49:58,170 --> 00:50:01,090 I'm inside the circle, and you could say well you could have 766 00:50:01,090 --> 00:50:05,350 seen that clearly by just using the triangle inequality. 767 00:50:05,350 --> 00:50:09,130 The magnitude of this can't be bigger than the magnitude of 768 00:50:09,130 --> 00:50:12,170 that, which is what? 769 00:50:12,170 --> 00:50:13,210 r. 770 00:50:13,210 --> 00:50:17,920 Plus the magnitude of that, which is what? 771 00:50:17,920 --> 00:50:19,530 1 minus r. 772 00:50:19,530 --> 00:50:22,260 So the magnitude by the triangle inequality can't be 773 00:50:22,260 --> 00:50:25,850 more than r plus 1 minus r which is 1. 774 00:50:25,850 --> 00:50:27,690 But now wait a minute, where did I 775 00:50:27,690 --> 00:50:34,740 use the Courant condition? 776 00:50:34,740 --> 00:50:37,120 The way I said that there sounded like it 777 00:50:37,120 --> 00:50:38,710 would always work. 778 00:50:38,710 --> 00:50:40,360 This has magnitude r. 779 00:50:40,360 --> 00:50:43,800 780 00:50:43,800 --> 00:50:45,580 What's going on here? 781 00:50:45,580 --> 00:50:49,320 Suppose r is bigger than 1, what's going wrong? 782 00:50:49,320 --> 00:50:53,220 In fact, what's the picture if r is bigger than 1? 783 00:50:53,220 --> 00:50:55,820 If r is bigger than 1, then my 1 minus 784 00:50:55,820 --> 00:50:59,600 r is out here somewhere. 785 00:50:59,600 --> 00:51:03,980 So this is the unstable case, 1 minus r, and then a circle 786 00:51:03,980 --> 00:51:08,450 of radio r, bad new right? 787 00:51:08,450 --> 00:51:11,670 Every frequency is unstable in fact. 788 00:51:11,670 --> 00:51:16,140 When I'm reaching too far, and that's just telling me I'm not 789 00:51:16,140 --> 00:51:18,810 using the information I need. 790 00:51:18,810 --> 00:51:24,230 I don't have a chance of keeping 791 00:51:24,230 --> 00:51:27,580 controlling any frequency. 792 00:51:27,580 --> 00:51:28,330 OK. 793 00:51:28,330 --> 00:51:33,240 I've got just enough time to show how bad this second 794 00:51:33,240 --> 00:51:33,890 method it is. 795 00:51:33,890 --> 00:51:37,400 So nobody wanted his name associated 796 00:51:37,400 --> 00:51:39,920 with that second method. 797 00:51:39,920 --> 00:51:41,070 Why is that? 798 00:51:41,070 --> 00:51:44,530 So what's the van Neumann quantity 799 00:51:44,530 --> 00:51:46,830 for the second method? 800 00:51:46,830 --> 00:51:49,420 OK. 801 00:51:49,420 --> 00:51:50,740 Just space here to write. 802 00:51:50,740 --> 00:51:53,490 803 00:51:53,490 --> 00:51:56,330 I want to know the number for that second method. 804 00:51:56,330 --> 00:52:05,690 So now the method is ujn plus 1 is ujn from the time 805 00:52:05,690 --> 00:52:22,610 difference plus r over 2, uj plus 1n minus uj minus 1n. 806 00:52:22,610 --> 00:52:25,780 807 00:52:25,780 --> 00:52:28,950 This is going to be the bad method. 808 00:52:28,950 --> 00:52:33,410 It looks good because the center difference is more 809 00:52:33,410 --> 00:52:37,530 accurate than a one sided difference, but it's also 810 00:52:37,530 --> 00:52:38,400 unstable here. 811 00:52:38,400 --> 00:52:42,970 Can you look at that and see what the van Neumann number g 812 00:52:42,970 --> 00:52:45,430 is going to be? 813 00:52:45,430 --> 00:52:48,390 Think of an exponential going in. 814 00:52:48,390 --> 00:52:51,220 What exponential comes out? 815 00:52:51,220 --> 00:52:56,730 So g is a 1 from this. 816 00:52:56,730 --> 00:53:00,880 Now this is our guys that's shifted over, so that would be 817 00:53:00,880 --> 00:53:07,410 in r over 2 e to the ik delta x just as it was before. 818 00:53:07,410 --> 00:53:17,070 And this one will be a minus r over 2 times e to the -- so 819 00:53:17,070 --> 00:53:20,880 it's back one step, so there will be and e to the 820 00:53:20,880 --> 00:53:26,310 minus ik delta x. 821 00:53:26,310 --> 00:53:27,560 So what's with this now? 822 00:53:27,560 --> 00:53:30,380 823 00:53:30,380 --> 00:53:35,970 g is 1 plus this quantity, r over 2 times e to the ikx 824 00:53:35,970 --> 00:53:38,980 minus d the minus ikx. 825 00:53:38,980 --> 00:53:41,760 What am I seeing there? 826 00:53:41,760 --> 00:53:48,740 I'm seeing 1 plus r, and everybody recognizes this 827 00:53:48,740 --> 00:54:03,950 minus this over 2 as i sin, ir sin k delta x. 828 00:54:03,950 --> 00:54:06,630 That's the amplification factor, and is it 829 00:54:06,630 --> 00:54:07,880 smaller than 1? 830 00:54:07,880 --> 00:54:10,300 831 00:54:10,300 --> 00:54:11,820 No way. 832 00:54:11,820 --> 00:54:12,300 No way. 833 00:54:12,300 --> 00:54:14,730 Let me raise it up here. 834 00:54:14,730 --> 00:54:19,400 So I don't care whether r is less than 1 or not, I'm lost. 835 00:54:19,400 --> 00:54:23,270 836 00:54:23,270 --> 00:54:25,670 This is a pure imaginary number. 837 00:54:25,670 --> 00:54:26,910 This is a real number. 838 00:54:26,910 --> 00:54:30,660 So I have the sum of squares to get the magnitude, it will 839 00:54:30,660 --> 00:54:36,220 be the square root of 1 plus r sin k delta x squared. 840 00:54:36,220 --> 00:54:41,370 So if I draw the bad picture then, what's the bad picture 841 00:54:41,370 --> 00:54:45,450 is, now it goes to 1 and then it goes way up 842 00:54:45,450 --> 00:54:48,180 the imaginary axis. 843 00:54:48,180 --> 00:54:52,270 Well maybe not way up but up. 844 00:54:52,270 --> 00:54:55,000 Sorry I shouldn't have made it quite as bad as it was. 845 00:54:55,000 --> 00:55:00,720 If I reduce r, I don't go so far up, but no hope. 846 00:55:00,720 --> 00:55:05,660 So do you see why that one is bad, because the amplification 847 00:55:05,660 --> 00:55:09,560 factor van Neumann tells us what Courant did not tell us. 848 00:55:09,560 --> 00:55:12,120 that the amplification factor here has 849 00:55:12,120 --> 00:55:13,800 magnitude bigger than 1. 850 00:55:13,800 --> 00:55:20,150 It's outside the circle, and every exponential is growing 851 00:55:20,150 --> 00:55:22,040 and there's no hope. 852 00:55:22,040 --> 00:55:22,540 OK. 853 00:55:22,540 --> 00:55:28,040 So the second last lecture on this section 52 of the notes 854 00:55:28,040 --> 00:55:33,950 will be about Lax-Friedrichs and Lax-Wendroff order of 855 00:55:33,950 --> 00:55:39,820 accuracy, stability and actual behavior in practice. 856 00:55:39,820 --> 00:55:40,250 Ok. 857 00:55:40,250 --> 00:55:41,100 See you Wednesday. 858 00:55:41,100 --> 00:55:42,350 Thanks.